package bigraph.commands;

import org.eclipse.draw2d.geometry.Rectangle;

import bigraph.model.Place;

public class PlaceChangeLayoutCommand extends AbstractLayoutCommand {
	
	private Place model;
	private Rectangle layout;
	private Rectangle oldLayout;
	
	public void execute() {
	     model.setLayout(layout);
	}

	@Override
	public void setConstraint(Rectangle rect) {
		this.layout = rect;

	}

	@Override
	public void setModel(Object model) {
		this.model = (Place)model;
		this.oldLayout = ((Place)model).getLayout();
	}
	
	public void undo() {
	     this.model.setLayout(this.oldLayout);
	}


}
